package com.stlm2.core.common.page;

import java.util.HashMap;
import java.util.Map;

/**
 * 分页查询的参数构造器
 *
 */
public class PageQueryParams {
	
	/**
	 * 查询条件别名
	 * 当分页时，传入的参数为Map类型，mapper文件需要采用（t.name）的形式获得参数值
	 */
	public static final String QUERY_OBJECT_NAME = "t";

	private PageView pageView;
	
	private Object params;
	
	public PageQueryParams(PageView pageView, Object params) {
		this.pageView = pageView;
		this.params = params;
	}
	
	public Map<String, Object> getMap(){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("t", params);
		map.put("paging", pageView);
		
		return map;
	}

	public PageView getPageView() {
		return pageView;
	}

	public Object getParams() {
		return params;
	}
}
